<?php
include_once('../../include/init.php');
$userid = $_POST['id'];
$content = $_POST['content'];
$sql_note = "insert into nettteach_note (`userid`,`content`,`time`) values(".$userid.",'".$content."',".time().")";
$db ->query($sql_note);
$sql ="select content,id,time from nettteach_note where userid = ".$_SESSION['sid']." order by time DESC limit 0,3";
$query =mysql_query($sql);
while($result =$db->fetch_array($query)){
    $content=mb_substr($result["content"],0,16,'utf-8');
    $str .='<li style="padding:5px;"><a style="color: blue" href="?do=note&id='.$result["id"].'" title='.$result["content"].'>'.$content.'</a><br/>('.date("Y-m-d H:i:s",$result["time"]).')</li>';

}

echo <<<XML
$str
XML;
?>
